﻿<%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl<DHAA.Areas.Administrator.Models.CategoryModels>" %>

   <%
    Ajax.BeginForm("Delete", "Category", FormMethod.Post,
                   new AjaxOptions
                       {
                           UpdateTargetId = "fancybox-content",
                           LoadingElementId = "loadingIcon",
                           OnBegin = "MvcFormOnBegin",
                           OnSuccess = "MvcFormOnSuccess",
                           OnComplete = "MvcFormOnComplete",
                           OnFailure = "MvcFormOnFailure"
                       }, new { enctype = "multipart/form-data" });
    {
%>
<%= Html.ValidationSummary(true) %>
<fieldset style="width: 640px">
    <legend>Delete category : <%= Html.DisplayTextFor(model=>model.CategoryName) %></legend>
    <div class="Message Error"><%= ViewData["MessageError"] %></div>
    <div class="Message Success"><%= ViewData["MessageSuccess"] %></div>
        
               
        <div class="display-label">CategoryName</div>
        <div class="display-field"><%= Html.DisplayTextFor(model => model.CategoryName)%><%= Html.HiddenFor(model=>model.CategoryName) %></div>
        <div class="cleared"></div>
       <div class="cleared"></div>
        <div class="display-label">Image</div><div id="preview">
               <% if (Html.DisplayTextFor(model=>model.Image).ToString() != "")
{
    %>
        <img src="<%=ResolveUrl("~/Default/Imagesproduct/")%><%= Html.DisplayTextFor(model=>model.Image) %>" alt="<%=Model.CategoryName %>"/>
    <%
}else{ %>
<img src="<%=ResolveUrl("~/Content/images/")%>noImage.jpg" alt="No image"/>


<%} %></div>
<%= Html.HiddenFor(model=>model.Image) %>
        <div class="cleared"></div>
        <div class="display-label">Description</div>
        <div class="display-field"><%= Html.DisplayTextFor(model => model.Description) %></div>
        <%= Html.HiddenFor(model=>model.Description) %>
       <div class="cleared"></div>
        <div class="display-label">ParentName</div>
        <div class="display-field"><%= Html.DisplayTextFor(model => model.ParentName) %></div>
        <div class="cleared"></div>
      <%= Html.HiddenFor(model=>model.ParentName) %>
        <div class="display-field"><%= Html.HiddenFor(model=>model.ChildCount) %></div>
        <div class="cleared"></div>
      
        <div class="display-field"><%= Html.HiddenFor(model=>model.ProductCount) %></div>
        <div class="cleared"></div>
    </fieldset>

        <p>
		    <input type="submit" value="Delete" /> |
		    <%= Html.ActionLink("Back to List", "Index") %>
        </p>
    <% } %>


